package com.whz.repeate;

import java.util.regex.Pattern;

/**
 * @Author: sinosoft
 * @Description: 校验是否包含罗马文字
 * @Date: Create in 12:40 2021/4/30
 * @Modified By:
 */
public class RomanNumberals {
    private static final Pattern ROMAN = Pattern.compile("^(?=.)M*(C[MD]|D?C{0,3})\n" +
            "(X[CL]|L?X{0,3})(I[TV]|V?I{0,3})$");
    public static boolean isRomanNumeral(String s) {
        return ROMAN.matcher(s).matches();
    }
}
